//
//  BangoHomeView.h
//  Bango
//

#import "BGOAnalyticsManagerDelegate.h"

@class BGOProfile;
@class BGOEvent;
@class BGOEventParameter;

@interface BangoHomeView : UIViewController <BGOAnalyticsManagerDelegate> {
	
	// the table view
	IBOutlet UITableView *_tableView;
	
	// The Create Profile Button
	IBOutlet UIButton *createProfileButton;
	
	// Button for ending the session
	IBOutlet UIButton *endSessionButton;
	
	// the entity name
	NSString *entityName;
  
  // holds the fetched items
	NSArray *_profiles;
  NSUInteger _profileIndex;
  NSUInteger _eventIndex;
	
	// the predicate for this current entity type
//	NSPredicate *entitySearchPredicate;
	
	// The field to sort by
//	NSString *sortByField;
	
	// this value is set as the event value
	IBOutlet UITextView *eventValue;

}

// loads the profiles
-(void) loadProfiles;

// holds the fetched items
@property(nonatomic, retain) NSArray *profiles;

// the button for creating a new profile
@property (nonatomic, retain) UIButton *createProfileButton; 

// the button for ending the current session
@property (nonatomic, retain) UIButton *endSessionButton; 

// entry box for event value
@property (nonatomic, retain) UITextView *eventValue; 

// the table view
@property (nonatomic, retain) IBOutlet UITableView* tableView; 

// the predicate for the search
//@property (nonatomic, retain) NSPredicate *entitySearchPredicate;

// the entity name for the database viewer
@property (nonatomic, retain) NSString *entityName;

@property (nonatomic) NSUInteger profileIndex;
@property (nonatomic) NSUInteger eventIndex;

// the sort by field
//@property (nonatomic, retain) NSString *sortByField;

///////////////////////////////////////////////////////
// Event Emulation

// handles pressing of the create profile button
- (IBAction) createProfile: (id) sender;

// handles pressing of the end session which emulates a session ending
- (IBAction) endSession: (id) sender;

// handles pressing of start idle emulation
- (IBAction) startIdle: (id) sender;

// handles pressing of end idle emulation
- (IBAction) endIdle: (id) sender;

// handles pressing of start video emulation
- (IBAction) startVideo: (id) sender;

// handles pressing of end video emulation
- (IBAction) endVideo: (id) sender;

// handles pressing of search emulation
- (IBAction) onSearch: (id) sender;

// handles pressing of page view emulation
- (IBAction) onPageView: (id) sender;

// handles error emulation
- (IBAction) logError: (id) sender;

// transmits data to bango - (same as what session end should do).
- (IBAction) transmit: (id) sender;

// refreshes table
- (IBAction) refresh: (id) sender;

- (void)transmitFailure;

- (void) transmitSuccess;

@end
